import requests

img_url = "https://git-scm.com/book/en/v2/images/undomerge-reset.png"
path = "D:/文件/项目/境外/images/2.png"
r = requests.get(img_url, stream=True)
# if r.status_code == 200:
#     with open(path, "wb") as f:
#         for chunk in r:
#             f.write(chunk)
if r.status_code == 200:
    open(path, "wb").write(r.content)